package com.bigflexlib.utils
{
	public class Arc
	{
		
		
		public var inverted:Boolean = false;
		
		public var label:*;
		
		public function Arc( label:*, inverted:Boolean = false )
		{
			this.label = label;
			this.inverted = inverted;
		}
		
		
		
		public function getBGP( fromVar:String, toVar:String ):String
		{
			var arr:Array = [ fromVar, label, toVar ];
			
			if ( inverted )
				arr.reverse( );
				
			return arr.join( " " );
		}
		
		
		
		
		public static function fromString( str:String ):Arc
		{
			var inverted:Boolean = false;
			if ( str.charAt( 0 ) == "-" )
			{
				str = str.substr( 1 );
				inverted = true;
			}
		
			return new Arc( str, inverted );
		}

	}
}